package com.ugoodtech.mdcc.core.repository;

import com.ugoodtech.mdcc.core.domain.QuestionGroup;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface QuestionGroupRepository extends PagingAndSortingRepository<QuestionGroup, Long>
        , QueryDslPredicateExecutor<QuestionGroup> {

    @Query("from QuestionGroup where section_id=:sectionId and deleted=false and enabled=true")
    List<QuestionGroup> getBySectionId(@Param("sectionId") Long sectionId);
}
